package com.easy.service.impl;

import com.easy.bean.Order;
import com.easy.dao.IOutOrderDao;
import com.easy.service.IOutOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OutOrderImpl implements IOutOrderService {
    @Autowired
    private IOutOrderDao dao;
    @Override
    public List<Order> getOrdersByOutId(String out_id) {
        return dao.getOrdersByOutId(out_id);
    }
    @Override
    public List<Order> getOutOrder() {
        return dao.getOutOrder();
    }

    @Override
    public List<Order> getShelfOutOrder() {
        return dao.getShelfOutOrder();
    }

    @Override
    public int addOutOrder(Order order) {
        return dao.addOutOrder(order);
    }

    @Override
    public int editOutOrder(Order order) {
        return dao.editOutOrder(order);
    }

    @Override
    public int delOutOrder(int id) {
        return dao.delOutOrder(id);
    }

    @Override
    public List<Order> searchOutOrder(String keyword) {
        return dao.searchOutOrder(keyword);
    }
    @Override
    public List<Order> getPagedOutOrder(int page, int size) {
        int offset = (page - 1) * size; // 计算 offset
        return dao.getPagedOutOrder(offset, size);
    }
    @Override
    public int getTotalOutOrderCount() {
        return dao.getTotalOutOrderCount();
    }

}
